# TODO: Add comment
# 
# Author: phamha
###############################################################################
library(raster)

shap=shapefile("/home/phamha/BDNEN/VNM_adm0.shp")
#rasterFile=raster("/home/phamha/BDNEN/MYD04_L2.A2014001_CB_10km.tif")
rasterFile=raster("/home/phamha/BDNEN/MYD04_L2.A2014002_CB_10km.tif")
#rasterFile=raster("/home/phamha/BDNEN/MYD04_L2.A2014003_CB_10km.tif")
#rasterFile=raster("/home/phamha/BDNEN/MYD04_L2.A2014004_CB_10km.tif")

rasterValues=values(rasterFile)
total=ncell(rasterValues)
rasterFile[1:total]=100

r=crop(rasterFile,shap)
r2=mask(r,shap)
rvalue=values(r2)
total_pixel2=sum(!is.na(rvalue))

rasterFile=raster("/home/phamha/Desktop/preci1.tif")
plot(rasterFile)






